package com.yao2san.simdif.service.synchronizer;

import lombok.Data;
import lombok.Getter;

import java.sql.*;
import java.util.Properties;
import java.util.logging.Logger;

/**
 * 数据源同步使用的驱动实例
 * @author wxg
 */
@Data
public class DriverInstance implements Driver {
    private final Driver driver;

    DriverInstance(Driver driver) {
        this.driver = driver;
    }

    @Override
    public boolean acceptsURL(String u) throws SQLException {
        return this.driver.acceptsURL(u);
    }

    @Override
    public Connection connect(String u, Properties p) throws SQLException {
        return this.driver.connect(u, p);
    }

    @Override
    public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
        return this.driver.getPropertyInfo(url, info);
    }

    @Override
    public int getMajorVersion() {
        return this.driver.getMajorVersion();
    }

    @Override
    public int getMinorVersion() {
        return this.driver.getMinorVersion();
    }

    @Override
    public boolean jdbcCompliant() {
        return this.driver.jdbcCompliant();
    }

    @Override
    public Logger getParentLogger() throws SQLFeatureNotSupportedException {
        return this.driver.getParentLogger();
    }
}
